﻿#region Using directives
using System;
using System.Linq;
using System.Windows.Forms;
using gpsMe.UI.Forms;
using gpsMe.Classes;
using System.IO;
using gpsMe.Utils;
#endregion

namespace gpsMe.Main
{
    /// <summary>
    /// gpsMe main class
    /// </summary>
    static class gpsMe
    {
        #region Entry point
        /// <summary>
        /// gpsMe entry point
        /// </summary>
        [MTAThread]
        static void Main()
        {
            /* Language loading */
            gpsMeLanguage.Instance.LoadLanguage(gpsMeUtils.ApplicationDirectory +  @"\Languages\English.language.xml");
            if (gpsMeLanguage.Instance.LanguageVersion != gpsMeLanguage.CURRENT_GPSMELANGUAGE_VERSION)
            {
                if (gpsMeLanguage.Instance.ErrorLanguageVersionNotSupportedField != "")
                    MessageBox.Show(gpsMeLanguage.Instance.ErrorLanguageVersionNotSupportedField);
                else
                    MessageBox.Show("Error : The loaded gpsMeLanguage version is not supported by this release");
            }
            else
            {
                Application.Run((Form)new gpsMeMainForm());
            }
        }
        #endregion
    }
}